package apiooday03;

import apiooday01.point;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class CollectionDemo {
    public static void main(String[] args) {
        Collection list = new ArrayList();

        list.add("123");
        System.out.println(list.isEmpty());//是否为空集合
        list.clear();//清空集合
        System.out.println(list.isEmpty());

        Collection c = new ArrayList();
        c.add(new point(200,300));
        c.add(new point(100,200));
        c.add(new point(200,300));
        c.add(new point(100,200));
        c.add(new point(300,400));
        c.add(new point(100,200));
        System.out.println(c);
        boolean contains =c.contains(new point(100,200));
        System.out.println(contains);
        c.remove(new point(100,200));
        System.out.println(c);

        Collection cc =new ArrayList();
        point  pp =new point(2,2);
        cc.add(pp);
        System.out.println(cc);
        pp.setX(3);
        System.out.println(cc);



//        point[] arr=new point[1];
//        point pp =new point(2,2);
//        arr[0]=pp;
//        System.out.println(Arrays.toString(arr));
//        pp.setX(3);
//        System.out.println(Arrays.toString(arr));
//

    }
}
